package com.cds.alert.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.cds.alert.dao.AlertLogMailMapper;
import com.cds.alert.ibatis.Criteria;
import com.cds.alert.pojo.AlertLogMail;
import com.cds.alert.service.AlertLogMailService;

@Service("alertLogMailService")
public class AlertLogMailServiceImpl implements AlertLogMailService {

	@Autowired
	private AlertLogMailMapper alertLogMailMapper;
	
	@Transactional(readOnly = true)
	public AlertLogMail selectByPrimaryKey(Long id) {
		return alertLogMailMapper.selectByPrimaryKey(id);
	}
	
	@Transactional(readOnly = true)
	public List<AlertLogMail> query(Criteria example) {
		return alertLogMailMapper.queryByExample(example);
	}
	
	@Transactional(readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
	public void insert(AlertLogMail entiry) {
		alertLogMailMapper.insert(entiry);
	}

}
